<% title "Администратор" %>

<div id="conteiner">
    <div id="left">
        <div id="leftCont">
        <%= link_to "Новости", admin_posts_path %><br/>
        <%= link_to "Создать категорию", new_admin_category_path %>
        <ul>
            <% @categories.each do |c| %>
		         <li><%= link_to c.title, edit_admin_category_path(c) %> - <%= link_to "редактировать", edit_admin_category_page_path(c) %> - <%= link_to "удалить", admin_category_path(c), :method=>:delete, :confirm=>"Удалить?" %> </li> 
	         		<% unless c.children_count == 0 %>
			       		<ul>
			       				<% c.direct_children.each do |ch| %>
			       					<li><%= link_to ch.title, edit_admin_category_path(ch) %> - <%= link_to "редактировать", edit_admin_category_page_path(ch) %> - <%= link_to "удалить", admin_category_path(ch), :method=>:delete, :confirm=>"Удалить?" %> </li> 
			       				<% end %>
			       		</ul>
	         		<% end %>
            <% end %>
         </ul>
         <%= will_paginate(@categories) %>
        </div>
    </div>
</div>

<div id="right">
		<%= render :partial=>"includes/currency" %>
		
    <%= render :partial=>"includes/banners" %>
</div>
